
////// window for help page

var modModalHelpPage = new Class({
	Extends:boxWindow,
	options: $extend({
		BtnRefresh: false,
		BtnMin: false,
		BtnHelp: false,
		BtnSettings: false,
		title: "",
		name: 'modModalHelpPage',
		uniqueCss: true,
		modal: true,
		BtnClose: true,
		fixed: true,
		left:0,
		top:0,
		width:600,
		isBox:false
	}),
	callerthis:null,

	///// get where to display the box
	initialize: function(callerthis){
		this.parent();
		this.callerthis=callerthis;
	}, 

	/////// load the info in the box
	onFinish: function(){
		var posx = (getWidth()/2 )-(this.options.width/2);
		var posy = (getHeight()/2)-(this.options.height/2);
        var scroll = $(document.body).getScroll().y;
		var overLay = $('modaloverlay');
		var modCss = this.options.uniqueCss ? this.options.name : '';		
		if(this.options.isBox){
			overLay.setStyle('width', this.options.width+'px'); 
			overLay.setStyle('height', this.options.height+'px'); 
			overLay.setStyle('top', posy); 
			//overLay.setStyle('left', posx); 
		} else { 
			overLay.setStyle('width', this.options.width+'px');
			overLay.setStyle('top' , (50+scroll) +'px'); 
			//overLay.setStyle('left', posx); 
		}
		var item_wrap = new Element('div', {'class':'help_content'}).injectInside(this.contentBox);

        var helppagepath = WF.util.getWidgetPath(this.callerthis.options.name)+"/" + this.callerthis.options.name + "/help/"+ lang.currlang + "/help.html";
    
    var javascript_url = homeBase + helppagepath;
    
    var helppageiframe=new IFrame({
    	 src: javascript_url,
    	 frameborder:"0",
         scrolling:"no",
         //"class": "help_iframe",
    	 styles:{
    	 	width :"100%",
    	 	height:"100%",
    	 	border: "0"
    	 }
    	}).injectInside(item_wrap);
        
		overLay.setStyle("padding",0);
	},
	
	closeModal:function(){
		this.callerthis=null;
		this.parent();
	}	
	

});


